import * as Cesium from 'cesium/Cesium';

export default class ImageProviderViewModels {
    constructor() {

    }
    static providerViewModels = [];
    /**
     * 加载默认底图
     */
    _initDefaultBaseLayer() {
        //google
        providerViewModels.push(new ProviderViewModel({
            name: '本地谷歌图',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/sentinel-2.png'),
            tooltip: '本地谷歌图.',
            category: '卫星影像',
            creationFunction: function () {
                return new Cesium.UrlTemplateImageryProvider({ url: '/bigmap/tile/gettile/GoogleChinaSatelliteHybird/{z}/{x}/{y}' })
            }
        }));
        //系统自带的naturalEarthII瓦片
        providerViewModels.push(new ProviderViewModel({
            name: 'NaturalEarthII',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
            tooltip: 'NaturalEarthII.',
            category: '卫星影像',
            creationFunction: function () {
                return Cesium.createTileMapServiceImageryProvider({ url: Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') })
            }
        }));
        providerViewModels.push(new ProviderViewModel({
            name: '谷歌地貌图',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/mapboxTerrain.png'),
            tooltip: '谷歌地貌图',
            category: '卫星影像',
            creationFunction: function () {
                return new Cesium.UrlTemplateImageryProvider({ url: '/bigmap/tile/gettile/GoogleChinaTerrain/{z}/{x}/{y}' })
            }
        }));
        providerViewModels.push(new ProviderViewModel({
            name: '地球夜景',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/earthAtNight.png'),
            tooltip: '地球夜景',
            category: '卫星影像',
            creationFunction: function () {
                return new Cesium.UrlTemplateImageryProvider({ url: '/bigmap/tile/gettile/ChinaOnlineStreetPurplishBlue/{z}/{x}/{y}' })
            }
        }));
        providerViewModels.push(new ProviderViewModel({
            name: '天地图',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/earthAtNight.png'),
            tooltip: '天地图影像',
            category: '卫星影像',
            creationFunction: () => {
                return new Cesium.WebMapTileServiceImageryProvider({
                    url: 'http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=f4d0553a23372a2f48c74851c7e46f4d',
                    layer: 'tdt',
                    minimumLevel: 0,
                    maximumLevel: 18,
                    style: 'default',
                    tileMatrixSetID: 'w',
                    format: 'image/jpeg',
                })
            }
        }));
        providerViewModels.push(new ProviderViewModel({
            name: '天地图矢量图',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/earthAtNight.png'),
            tooltip: '天地图矢量',
            category: '矢量地图',
            creationFunction: () => {
                return new Cesium.WebMapTileServiceImageryProvider({
                    url: "http://{s}.tianditu.gov.cn/vec_c/wmts?service=wmts&request=GetTile&version=1.0.0" +
                        "&LAYER=vec&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}" +
                        "&style=default&format=tiles&tk=f4d0553a23372a2f48c74851c7e46f4d",
                    layer: "gdVecBasicLayer",
                    style: "default",
                    format: "tiles",
                    tileMatrixSetID: "c",
                    subdomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
                    tilingScheme: new Cesium.GeographicTilingScheme(),
                    tileMatrixLabels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15",
                        "16", "17", "18", "19"
                    ],
                    maximumLevel: 18,
                })
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name: '高德影像',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/earthAtNight.png'),
            tooltip: '高德影像',
            category: '卫星影像',
            creationFunction: () => {
                return new Cesium.WebMapTileServiceImageryProvider({
                    url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
                    layer: 'tdt',
                    minimumLevel: 0,
                    maximumLevel: 18,
                    style: 'default',
                    tileMatrixSetID: 'w',
                    format: 'image/jpeg',
                })
            }
        }));
   
        providerViewModels.push(new ProviderViewModel({
            name : 'Bing卫星地图',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/bingAerial.png'),
            tooltip : '必应卫星地图',
            category: '卫星影像',
            creationFunction : function() {
                return createWorldImagery({
                    style : IonWorldImageryStyle.AERIAL
                });
            }
        }));
        //必应带标记地图，标记有偏移
        providerViewModels.push(new ProviderViewModel({
            name : 'Bing Maps Aerial with Labels',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/bingAerialLabels.png'),
            tooltip : 'Bing Maps aerial imagery with labels, provided by Cesium ion',
            category : 'Cesium ion',
            creationFunction : function() {
                return createWorldImagery({
                    style : IonWorldImageryStyle.AERIAL_WITH_LABELS
                });
            }
        }));
        //必应道路地图  有偏移
        providerViewModels.push(new ProviderViewModel({
            name : 'Bing Maps Roads',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/bingRoads.png'),
            tooltip : 'Bing Maps standard road maps, provided by Cesium ion',
            category : 'Cesium ion',
            creationFunction : function() {
                return createWorldImagery({
                    style : IonWorldImageryStyle.ROAD
                });
            }
        }));
       providerViewModels.push(new ProviderViewModel({
            name : '省级蓝图',
            iconUrl : URLS.BlueMAP,
            tooltip : '必应卫星地图',
            category: '卫星影像',
            creationFunction : function() {
                return new UrlTemplateImageryProvider({
                    url : URLS.BlueMAP,
                    enablePickFeatures : false
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name: 'Mapbox卫星地图',
            tooltip: 'Mapbox卫星影像https://www.mapbox.com/maps/',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/mapboxSatellite.png'),
            category : '卫星影像',
            creationFunction: function() {
                return new MapboxImageryProvider({
                    mapId: 'mapbox.satellite'
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name: 'Mapbox街道地图',
            tooltip: 'Mapbox街道影像 https://www.mapbox.com/maps/',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/mapboxTerrain.png'),
            category : '在线地图',
            creationFunction: function() {
                return new MapboxImageryProvider({
                    mapId: 'mapbox.streets'
                });
            }
        }));

       providerViewModels.push(new ProviderViewModel({
            name: '街道地图',
            tooltip: 'Mapbox街道影像 https://www.mapbox.com/maps/',
            iconUrl: buildModuleUrl('Widgets/Images/ImageryProviders/mapboxStreets.png'),
            category : '矢量图层',
            creationFunction: function() {
                return new MapboxImageryProvider({
                    mapId: 'mapbox.streets-basic'
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : 'ESRI全球影像',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/esriWorldImagery.png'),
            tooltip : 'ArcGis全球影像',
            category : '卫星影像',
            creationFunction : function() {
                return new ArcGisMapServerImageryProvider({
                    url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
                    enablePickFeatures : false
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : 'ESRI全球街道地图',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/esriWorldStreetMap.png'),
            tooltip : 'ArcGis全球街道地图',
            category : '矢量图层',
            creationFunction : function() {
                return new ArcGisMapServerImageryProvider({
                    url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer',
                    enablePickFeatures : false
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : 'ESRI自然地理图',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/esriNationalGeographic.png'),
            tooltip : '用于信息和教育目的，以及由地理信息系统专业人员和其他用户创建Web地图和Web的底图',
            category : '矢量图层',
            creationFunction : function() {
                return new ArcGisMapServerImageryProvider({
                    url : 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/',
                    enablePickFeatures : false
                });
            }
        }));

    providerViewModels.push(new ProviderViewModel({
            name : 'Open\u00adStreet\u00adMap',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
            tooltip : 'OSM地图',
            category : '矢量图层',
            creationFunction : function() {
                return createOpenStreetMapImageryProvider({
                    url : 'https://a.tile.openstreetmap.org/'
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : '水彩地图',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/stamenWatercolor.png'),
            tooltip : '水彩地图.\nhttp://maps.stamen.com',
            category : '矢量图层',
            creationFunction : function() {
                return createOpenStreetMapImageryProvider({
                    url : 'https://stamen-tiles.a.ssl.fastly.net/watercolor/',
                    credit : 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.'
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : '水墨地图',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/stamenToner.png'),
            tooltip : '水墨地图.\nhttp://maps.stamen.com',
            category : '矢量图层',
            creationFunction : function() {
                return createOpenStreetMapImageryProvider({
                    url : 'https://stamen-tiles.a.ssl.fastly.net/toner/',
                    credit : 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.'
                });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : 'Sentinel-2',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/sentinel-2.png'),
            tooltip : 'Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).',
            category : 'Cesium ion',
            creationFunction : function() {
                return new IonImageryProvider({ assetId: 3954 });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : 'Blue Marble',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/blueMarble.png'),
            tooltip : 'Blue Marble Next Generation July, 2004 imagery from NASA.',
            category : 'Cesium ion',
            creationFunction : function() {
                return new IonImageryProvider({ assetId: 3845 });
            }
        }));

        providerViewModels.push(new ProviderViewModel({
            name : '地球夜景',
            iconUrl : buildModuleUrl('Widgets/Images/ImageryProviders/earthAtNight.png'),
            tooltip : '地球夜景.',
            category : '矢量图层',
            creationFunction : function() {
                return new IonImageryProvider({ assetId: 3812 });
            }
        }));

       




    
       


    }


}